<?php

/**
 * ZonasViviendas form base class.
 *
 * @method ZonasViviendas getObject() Returns the current form's model object
 *
 * @package    costabravasfr
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 24171 2009-11-19 16:37:50Z Kris.Wallsmith $
 */
abstract class BaseZonasViviendasForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'zona'         => new sfWidgetFormInputHidden(),
      'municipio'    => new sfWidgetFormInputText(),
      'zona_desc_ca' => new sfWidgetFormTextarea(),
      'zona_desc_es' => new sfWidgetFormTextarea(),
      'zona_desc_en' => new sfWidgetFormTextarea(),
      'zona_desc_nl' => new sfWidgetFormTextarea(),
      'zona_desc_fr' => new sfWidgetFormTextarea(),
      'slug'         => new sfWidgetFormInputText(),
    ));

    $this->setValidators(array(
      'zona'         => new sfValidatorDoctrineChoice(array('model' => $this->getModelName(), 'column' => 'zona', 'required' => false)),
      'municipio'    => new sfValidatorString(array('max_length' => 30, 'required' => false)),
      'zona_desc_ca' => new sfValidatorString(array('required' => false)),
      'zona_desc_es' => new sfValidatorString(array('required' => false)),
      'zona_desc_en' => new sfValidatorString(array('required' => false)),
      'zona_desc_nl' => new sfValidatorString(array('required' => false)),
      'zona_desc_fr' => new sfValidatorString(array('required' => false)),
      'slug'         => new sfValidatorString(array('max_length' => 255, 'required' => false)),
    ));

    $this->validatorSchema->setPostValidator(
      new sfValidatorDoctrineUnique(array('model' => 'ZonasViviendas', 'column' => array('slug')))
    );

    $this->widgetSchema->setNameFormat('zonas_viviendas[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'ZonasViviendas';
  }

}
